import request from '@/utils/request.js'

export function getPkgGroupListPage(data){
    return request({
        url: 'pkg/group/listPage',
        method: 'post',
        data
    })
}

export function getPkgGroupList(data){
    return request({
        url: 'pkg/group/list',
        method: 'post',
        data
    })
}

export function getPkgsList(data){
    return request({
        url: 'pkg/group/list',
        method: 'post',
        data
    })
}
export function addPkgGroup(data){
    return request({
        url: 'pkg/group/add',
        method: 'post',
        data
    })
}

export function updatePkgGroup(data){
    return request({
        url: 'pkg/group/update',
        method: 'post',
        data
    })
}

export function changePkgGroupState(data){
    return request({
        url: 'pkg/group/state',
        method: 'post',
        data
    })
}


export function getPkgListPage(data){
    return request({
        url: 'pkg/listPage',
        method: 'post',
        data
    })
}

// export function getPkgList(data){
//     return request({
//         url: 'pkg/list',
//         method: 'post',
//         data
//     })
// }

export function addPkg(data){
    return request({
        url: 'pkg/add',
        method: 'post',
        data
    })
}

export function updatePkg(data){
    return request({
        url: 'pkg/update',
        method: 'post',
        data
    })
}

export function getPkgDetail(data){
    return request({
        url: 'pkg/detail',
        method: 'post',
        data
    })
}

export function changePkgState(data){
    return request({
        url: 'pkg/state',
        method: 'post',
        data
    })
}



export function getPkgSoldListPage(data){
    return request({
        url: 'pkg/sold/admin/listPage',
        method: 'post',
        data
    })
}
export function pkgDistribut(data){
    return request({
        url: 'pkg/sold/add',
        method: 'post',
        data
    })
}
export function pkgDistributCancel(data){
    return request({
        url: 'pkg/sold/cancel',
        method: 'post',
        data
    })
}
export function updateSoldPercent(data){
    return request({
        url: 'pkg/sold/updatePercent',
        method: 'post',
        data
    })
}
export function updateSoldPercent1(data){
    return request({
        url: 'pkg/sold/updatePercent/price',
        method: 'post',
        data
    })
}

export function getAgentPkgListPage(data){
    return request({
        url: 'pkg/sold/listPage',
        method: 'post',
        data
    })
}
export function updateAgentPkg(data){
    return request({
        url: 'pkg/sold/updatePrice',
        method: 'post',
        data
    })
}
export function changeAgentPkgState(data){
    return request({
        url: 'pkg/sold/state',
        method: 'post',
        data
    })
}

/********套餐划拨**********/
export function getAgentPkgSoldListPage(data){
    return request({
        url: 'pkg/sold/agent/listPage',
        method: 'post',
        data
    })
}

/********下拉框接口**********/
export function getPkgTypeOption(data){
    return request({
        url: 'pkg/type/dict',
        method: 'get',
        data
    })
}
export function getPkgStateOption(data){ 
    return request({
        url: 'pkg/state/dict',
        method: 'get',
        data
    })
}
export function getSupplierOption(data){
    return request({
        url: 'sim/supplier/type/dict',
        method: 'get',
        data
    })
}
export function getSimTypeOption(data){
    return request({
        url: 'sim/type/dict',
        method: 'get',
        data
    })
}
export function getPkgIsMonthOption(data){
    return request({
        url: 'pkg/group/isMonth/dict',
        method: 'get',
        data
    })
}
/********当前代理商可搜索的套餐组**********/
export function getAgentPkgGroupList(data){
    return request({
        url: 'sim/search/allow/pkgGroup',
        method: 'get',
        data
    })
}
/********代理商套餐排序**********/
export function agentPkgSort(data){
    return request({
        url: 'pkg/sold/sort',
        method: 'post',
        data
    })
}
/********管理员套餐排序**********/
export function adminPkgSort(data){
    return request({
        url: 'pkg/sort',
        method: 'post',
        data
    })
}
/********获取套餐组下的套餐**********/
export function getPkgOfGroup(data){
    return request({
        url: 'pkg/list',
        method: 'post',
        data
    })
}

